package com.example.qxfw.hbqx.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.qxfw.common.entity.qx.MsgMediumSmallScaleTemp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;


import java.util.Date;
import java.util.List;

@Mapper
@DS("qx")
public interface MsgMediumSmallScaleTempMapper extends BaseMapper<MsgMediumSmallScaleTemp> {
    /**
     *根据观测时间段查询站点id，名字，和时间
     * @param observtimeStart 观测时间起点
     * @param observtimeEnd 观测时间终点
     * @return
     */
    @Select("SELECT stationid, stationname, observtime " +
            "FROM msgmediumsmallscaletemp " +
            "WHERE observtime > #{observtimeStart} AND observtime <= #{observtimeEnd} "+
            "ORDER BY observtime ")
    List<MsgMediumSmallScaleTemp> selectByObservtimeOfMsgMediumSmallScaleTemp(Date observtimeStart, Date observtimeEnd);

    /**
     *（去重）根据观测时间段查询站点id，名字，和时间
     * @param observtimeStart 观测时间起点
     * @param observtimeEnd 观测时间终点
     * @return
     */
    @Select("SELECT stationid, stationname, distinct observtime " +
            "FROM msgmediumsmallscaletemp " +
            "WHERE observtime > #{observtimeStart} AND observtime <= #{observtimeEnd} "+
            "ORDER BY observtime ")
    List<MsgMediumSmallScaleTemp> selectByObservtimeDsitOfMsgMediumSmallScaleTemp(Date observtimeStart, Date observtimeEnd);



}
